#pragma once
#include "server.h"

class Seat {
public:
    Seat(Server* server);
    ~Seat();

private:
    void handle_new_input(wlr_input_device* device);

private:
    struct wlr_seat *m_seat;
    Server *m_server;
    struct wlr_keyboard_group *m_keyboard_group;

    wl_listener_wrapper m_new_input;

    struct wl_list m_inputs;
#if 0
    struct wl_list touch_points; /* struct touch_point.link */

    /*
     * Enum of most recent server-side cursor image.  Set by
     * cursor_set().  Cleared when a client surface is entered
     * (in that case the client is expected to set its own cursor image).
     */
    enum lab_cursors server_cursor;
    struct wlr_cursor *cursor;
    struct wlr_xcursor_manager *xcursor_manager;
    struct {
        double x, y;
    } smooth_scroll_offset;

    struct wlr_pointer_constraint_v1 *current_constraint;

    /* In support for ToggleKeybinds */
    uint32_t nr_inhibited_keybind_views;

    /* Used to hide the workspace OSD after switching workspaces */
    struct wl_event_source *workspace_osd_timer;
    bool workspace_osd_shown_by_modifier;

    /* if set, views cannot receive focus */
    struct wlr_layer_surface_v1 *focused_layer;

    /**
     * pressed view/surface/node will usually be NULL and is only set on
     * button press while the mouse is over a view or surface, and reset
     * to NULL on button release.
     * It is used to send cursor motion events to a surface even though
     * the cursor has left the surface in the meantime.
     *
     * This allows to keep dragging a scrollbar or selecting text even
     * when moving outside of the window.
     *
     * Both (view && !surface) and (surface && !view) are possible.
     */
    struct {
        struct view *view;
        struct wlr_scene_node *node;
        struct wlr_surface *surface;
        struct wlr_surface *toplevel;
        uint32_t resize_edges;
    } pressed;

    struct {
        bool active;
        struct {
            struct wl_listener request;
            struct wl_listener start;
            struct wl_listener destroy;
        } events;
        struct wlr_scene_tree *icons;
    } drag;

    /* Private use by regions.c */
    struct region *region_active;
    struct region_overlay region_overlay;
    /* Used to prevent region snapping when starting a move with A-Left */
    bool region_prevent_snap;

    struct wl_client *active_client_while_inhibited;
    struct wl_listener focus_change;

    struct wl_listener cursor_motion;
    struct wl_listener cursor_motion_absolute;
    struct wl_listener cursor_button;
    struct wl_listener cursor_axis;
    struct wl_listener cursor_frame;

    struct wlr_pointer_gestures_v1 *pointer_gestures;
    struct wl_listener pinch_begin;
    struct wl_listener pinch_update;
    struct wl_listener pinch_end;
    struct wl_listener swipe_begin;
    struct wl_listener swipe_update;
    struct wl_listener swipe_end;

    struct wl_listener request_cursor;
    struct wl_listener request_set_shape;
    struct wl_listener request_set_selection;
    struct wl_listener request_set_primary_selection;

    struct wl_listener touch_down;
    struct wl_listener touch_up;
    struct wl_listener touch_motion;
    struct wl_listener touch_frame;

    struct wl_listener constraint_commit;
    struct wl_listener pressed_surface_destroy;

    struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
    struct wl_listener virtual_pointer_new;

    struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
    struct wl_listener virtual_keyboard_new;
#endif
};
